import cv2
import numpy as np

# 读取图像
image = cv2.imread('image.jpg')
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

# 应用Shi-Tomasi角点检测
corners = cv2.goodFeaturesToTrack(gray_image, 100, 0.01, 10)
corners = np.int0(corners)

# 在图像上绘制角点
for corner in corners:
    x, y = corner.ravel()
    cv2.circle(image, (x, y), 3, 255, -1)

# 显示结果
cv2.imshow('Shi-Tomasi Corners', image)
cv2.waitKey(0)
cv2.destroyAllWindows()